package com.wzcl.app.service;

import com.wzcl.app.dao.model.Commodity;
import com.wzcl.app.dao.model.common.Base;
import com.wzcl.app.model.common.MyPage;
import com.wzcl.app.model.dto.CommodityDto;

import java.util.List;

public interface CommodityService extends BaseService<Commodity, CommodityDto>{
    Commodity addCommodity(CommodityDto commodityDto);

    void delCommodityByResource(Integer resourceId, Integer resourceType);

    Commodity updateCommodity(CommodityDto commodityDto);

    Commodity getCommodityById(Integer id);

    Base getResource(CommodityDto commodityDto);

    List<Commodity> getCommodityList(CommodityDto commodityDto);

    List<Commodity> getCommodityListByIds(List<Integer> commodityIdList);

    MyPage<Commodity> getCommodityPage(CommodityDto commodityDto);

    Commodity saleCommodity(Integer id);

    Commodity unSaleCommodity(Integer id);

    Commodity bindActivity(CommodityDto commodityDto);

    Commodity getAndCheckCommodityById(Integer commodityId);

    void decreaseStock(Commodity... commodities);

    void increaseStock(Commodity... commodities);

    void check(Commodity commodity);
}
